PROPERTY:  Document::forms


document.forms["formID" ]

This property is an array containing references to all the Form objects in the current document. These references are stored in the array in the order in which they are defined in the source code. The "formID" argument is used to access items in the array and this can either be a string containing the form name as defined within the <FORM> tag in the HTML source, or an integer (with '0' being the first item in the array).

All examples below return the same results; the first uses the defined names of the forms and the second uses their reference number within the array.

Code:
document.forms["formname1"]
document.forms["formname2"]
document.forms["formname3"]

document.forms[0]
document.forms[1]
document.forms[2]


Because a separate property is assigned to the document object for each form, (see the document.formname property) you can also use the following syntax.

document.formname1
document.formname2
document.formname3


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information